using UnityEngine;
using System.Collections;

public class Return : MonoBehaviour {
	
	public GameObject desative;
	public GameObject desative2;
	public GameObject restore;
	public GameObject save;
	public string removeMission;
	public EticaPersonagem etica;
	public float waitForSeconds;
	public bool utilitarismo;
	public CharacterMove person;
	public GameObject obj;
	float timer;
	
	void Start()
	{
		person = obj.GetComponent<CharacterMove>();
	}
	
	void Update () 
	{
		timer += Time.deltaTime;
		if(timer > waitForSeconds)
		{
			desative.SetActiveRecursively(false);
			restore.SetActiveRecursively(true);
			save.SetActiveRecursively(false);
			
			if(utilitarismo)
			{
				etica.Utilitarismo();
			}
			else
			{
				etica.Retributivismo();
			}
			desative.SetActiveRecursively(false);
			person.MissionConclusion(removeMission);
			person.activeNPC();
			waitForSeconds = 0;
		}
	}
}
